package labelsystem.utils;/**
 * @projectName careOlder
 * @Description TODO
 * @author MCG
 * @time 2023/3/7 20:09
 */

import org.springframework.stereotype.Component;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

/**
 *description: 生成随机数的工具类
 *@author MCG
 *@date 2023/3/7 20:09
 *@Version 1.0
 */
public class RandomUtil {

    private static final Random random = new Random();

    private static final DecimalFormat fourdf = new DecimalFormat("0000");
    private static final DecimalFormat sixdf = new DecimalFormat("000000");

    public static String getFourBitRandom() {
        return fourdf.format(random.nextInt(10000));
    }

    public static String getSixBitRandom() {
        return fourdf.format(random.nextInt(1000000));
    }

}
